package principle.composite;

/**
 * @author malguy-wang sir
 * @create ---
 */
public abstract class organizationComponent {
   private String name;//名字
   private String des;//说明
   public organizationComponent(String name, String des) {
        this.name = name;
        this.des = des; }
   public String getName() { return name; }
   public void setName(String name) { this.name = name; }
   public String getDes() { return des; }
   public void setDes(String des) { this.des = des; }
   //添加
   protected void add(organizationComponent organizationComponent){
       //默认实现
       throw new UnsupportedOperationException();//抛出不可操作异常
   }
   //删除
   protected void remove(organizationComponent organizationComponent){
       //默认实现
       throw new UnsupportedOperationException();//抛出不可操作异常
   }
   //抽象print方法，子类都要实现
   protected abstract void print();
}
